<template>
  <div class="fdx-no-result">
    <div class="no-result-image" v-if="icon"></div>
    <div class="info">
      <div class="fdx-icon-info"></div>
      <div class="no-result-text">{{title}}</div>
    </div>
    <div
      class="no-result-clear"
      v-if="clear"
      @click="onClear">
      清空条件
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
export default {
  props: {
    title: {
      type: String,
      default: '暂无数据'
    },
    clear: {
      type: Boolean,
      default: false
    },
    icon: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    onClear() {
      Toast('条件已清空！')
      this.$emit('clear')
    }
  }
}
</script>

<style lang="scss">
@import "../../assets/sass/_vars";
.fdx-no-result {
  color: $gray-lighter;
  display: flex;
  flex-flow: column;
  justify-content: center;
  align-items: center;
  margin: 0px 15px;

  .info {
    display: flex;
    align-items: center;

    .no-result-text {
      margin-left: 5px;
      text-align: left;
      flex-grow: 1;
    }
  }

  .no-result-clear {
    font-size: 12px;
    color: $blue;
    border-bottom: 1px solid $blue;
    display: inline-block;
    margin-top: 15px;
  }
}
  .no-data-text.active{
    font-size: 14px;
  }
  .no-result-image{
    // background: url('./blank.png') center center no-repeat;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    width: 100px;
    height: 100px;
    margin-right: 14px;
    // margin-top: 50px;
  }
</style>